package org.csmzxy.class2333;

public class classwork04 {
    public static void main(String[] args) {
        int num1 = 48;
        int num2 = 72;
        int gcd = getGCD(num1, num2);
        int lcm = getLCM(num1, num2, gcd);
        System.out.println("最大公约数: " + gcd);
        System.out.println("最小公倍数: " + lcm);
    }
    public static int getGCD(int a, int b) {
        while (b != 0) {
            int temp = a % b;
            a = b;
            b = temp;
        }
        return a;
    }

    public static int getLCM(int a, int b, int gcd) {
        return (a * b) / gcd;
    }
}
